package com.huosu.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 用户信息
 * </p>
 *
 * @author zhangjian
 * @since 2019-12-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("web_user")
@ApiModel(value="User对象", description="用户表")
public class User extends Model<User> implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "真实姓名")
    private String realname;

    @ApiModelProperty(value = "登录密码")
    private String password;

    @ApiModelProperty(value = "维护密码")
    private String maintainPass;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "用户角色")
    private Integer role;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private String createTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private String updateTime;

    @ApiModelProperty(value = "最后登录时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private String lastTime;

    @ApiModelProperty(value = "锁定状态（0：正常，1：锁定）")
    private Integer lockFlag;

    @ApiModelProperty(value = "删除状态（0：正常，1：删除）")
    private Integer delFlag;

    @TableField(exist = false)
    @ApiModelProperty(value = "角色名称")
    private String roleName;

    @TableField(exist = false)
    @ApiModelProperty(value = "权限")
    private List<String> access;

}
